package com.wxxymakers.grademark.model.entity;


import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 
 */
@Data
@TableName(value = "wx_users", resultMap = "JsonAllMap")
public class WxUser implements Serializable {
    @TableId
    private Integer id;

    @TableField(condition = SqlCondition.LIKE)
    private String name;

    /**
     * 职工号
     */
    private String jobNum;

    /**
     * 用户角色id
     */
    private Integer roleId;
    @TableField(exist = false)
    private WxRole role = new WxRole();

    /**
     * 0未知 1男 2女
     */
    private String sex;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;

    /**
     * 学院id
     */
    private Integer collageId;
    @TableField(exist = false)
    private WxCollege college = new WxCollege();

    /**
     * 所在部门id
     */
    private Integer deptId;
    @TableField(exist = false)
    private WxDepartment department = new WxDepartment();

    /**
     * 现任职务id
     */
    private Integer dutyId;
    @TableField(exist = false)
    private WxDuty duty = new WxDuty();

    /**
     * 现任职务的等级
     */
    private Integer dutyLevel;

    private String tel;

    private String email;

    /**
     * 任现职务时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField("n_datetime")
    private Date ntime;

    /**
     * 最开始的上岗时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField("w_datetime")
    private Date wtime;

    /**
     * 用户登录名，使用工号
     */
    private String username;

    /**
     * 用户登录密码
     */
    private String password;

    private String cover;

    private static final long serialVersionUID = 1L;
}